﻿@model bool?

@{ 
    SelectList list = ViewData.ModelMetadata.IsNullableValueType
        ? new SelectList(
            new List<SelectListItem>
            {
                new SelectListItem { Value = "0", Text = "Not Set" },
                new SelectListItem { Value = "1", Text = "Male" },
                new SelectListItem { Value = "2", Text = "Female" }
            },
            "Value",
            "Text",
            Model)
        : new SelectList(
            new List<SelectListItem>
            {
                new SelectListItem { Value = "1", Text = "Male" },
                new SelectListItem { Value = "2", Text = "Female" }
            },
            "Value",
            "Text",
            Model);
}

<div class="sale-setup-label-container">@Html.LabelFor(m => m)</div>
<div class="sale-setup-input-container">
    @Html.DropDownListFor(m => m,
        list,
        new Dictionary<string, object> {
            { "data-bind", "value:" + TN_CMS.Framework.Helper.CommonHelper.GetFullHtmlFieldNameWithoutPrefix(ViewData.TemplateInfo.GetFullHtmlFieldName(string.Empty)) },
            { "style", "width:auto" }
        })
</div>
<div style="clear:both;height:10px;font-size:0px"></div>